import { getCurSessionInfo } from '@/api/global'

const getDefaultState = () => {
  return {
    curSession:{}
  }
}
const state = getDefaultState()
const mutations = {
  RESET_STATE: (state) => {
    Object.assign(state, getDefaultState())
  },
  set_session: (state, s) => {

    state.curSession = s
  }
}
const actions = {
  getSession(context, s) {
    getCurSessionInfo().then((response)=>{
      context.commit('set_session',response.data)
    })
  }
}
export default {
  namespaced: true, state, mutations, actions
}


